<?php

namespace app\common\model;

use think\Model;

class TaobaoConfig extends Model
{
    // 表名
    protected $name = 'taobao_config';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    
    // 追加属性
    protected $append = [
		'pv_text'
    ];
    
	CONST PV_ANDROID = 0;
	const PV_IOS = 1;
    
	public static $pvList = [
		self::PV_IOS => '苹果平台',
		self::PV_ANDROID => '安卓平台',
	];

	
	public function getPvTextAttr($value, $data) {
		$value = $value ? $value : $data['pv'];
		$list = self::$pvList;
		return isset($list[$value]) ? $list[$value] : '';
	}




}
